Ext.define('appmod.view.knowledge.ColligationDashboard', {
    extend: 'Ext.panel.Panel',
    alias: [
		'widget.knowledge.colligationdashboard',
		'widget.knowledge-colligationdashboard'
	],
    region : 'center',

	requires: [
		'appmod.view.knowledge.category.TreeGrid',
		'appmod.view.knowledge.content.colligation.MainGrid'
	],	
	border : false,
	margins:"5 5 5 5",

	constructor: function (config) {
		
		if (config.fieldStores) {
			this.stores = config.stores;
		}
        this.callParent(arguments);
     },	

    initComponent: function() {
        var me = this;
		
		// --- binding store ---
		var dsCategory = me.stores['category'];
	
        Ext.applyIf(me,{
		    layout : {
				type:'border'
			},			
			items:[
				{
					store:dsCategory,
			        rootVisible: false,
			        useArrows: true,
			        frame: true,
					title:'信息分类',
					collapsible:false,					
					xtype:'knowledge.tree.grid',
					region:'west',
					split:true,
					margins:"5 0 5 5",
					width:200,
					dockedItems:[{
					    xtype: 'toolbar',
					    dock: 'top',
						items:[
						{
							xtype:'button',
							text:'添加',
							action:'addCategory'							
						},
						{
							xtype:'button',
							text:'删除',
							action:'deleteCategory'							
						}
						]						
					}]					
				},
				{
					xtype:'knowledge.content.colligation.maingrid',
					region:'center',	
					layout:'border',
					autoScroll:true,
					margins:"5 5 5 0"
				}
			]
			
		});

        me.callParent(arguments);

    }
});